<!--
 * @Description:  cfa-题库报告 -- CFAReport
 * @Author: your name
 * @Date: 2024-01-04
 * @LastEditTime: 2024-01-04
 * @LastEditors: Please set LastEditors
-->

<template>
  <div>
    <div class="CFAReport heart_w">
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item> FRM </el-breadcrumb-item>
        <el-breadcrumb-item> 一级 </el-breadcrumb-item>
        <el-breadcrumb-item>
          Foundations of Risk Management（风险管理基础）
        </el-breadcrumb-item>
      </el-breadcrumb>

      <div class="result">
        <div class="wrapper">
          <p class="test_title">
            Chapter 1 ：The Building Blocks of Risk Management
          </p>
          <p class="bt">正确率</p>
          <div class="zuoc_l">
            <el-progress
              type="circle"
              :percentage="Number(accuracy)"
              :stroke-width="6"
              color="#47c88a"
            >
            </el-progress>
            <p class="zuoc_l2">
              <span><i class="zuoc_l2_l"></i>正确率</span>
            </p>
          </div>

          <div class="four_type">
            <div>
              <p style="color: #2b92f9">12<span>题</span></p>
              <small>本次答题总数目</small>
            </div>
            <div>
              <p style="color: #ff6c6c">00<span>题</span></p>
              <small>本次对题总数目</small>
            </div>
            <div>
              <p style="color: #9aa1ac">89<span>题</span></p>
              <small>本次做题总数目</small>
            </div>
            <div>
              <p style="color: #ffd007">22秒</p>
              <small>本次答题用时</small>
            </div>
          </div>
        </div>
      </div>

      <div class="answer_card">
        <div class="wrapper">
          <p class="test_title">答题卡</p>
          <p class="answer_result">
            <span><i class="yes"></i>答对</span>
            <span><i class="no"></i>答错</span>
            <span><i class="nodo"></i>未做</span>
          </p>
          <!-- 案例case -->
          <p class="bt" v-if="casenum !== 1">【案例分析题】</p>
          <ul>
            <li
              :class="
                casetopic.is_true == 0
                  ? 'no'
                  : casetopic.is_true == 1
                  ? 'yes'
                  : 'nodo'
              "
              v-for="(casetopic, index) in 15"
              :key="'case' + index"
            >
              {{ index + 1 }}
            </li>
          </ul>
          <!-- 单项选择test -->
          <p class="bt" v-if="testnum !== 1">【单项选择题】</p>
          <ul>
            <li
              :class="
                topic.is_true == 0 ? 'no' : topic.is_true == 1 ? 'yes' : 'nodo'
              "
              v-for="(topic, index) in 10"
              :key="index"
            >
              {{ index + 1 + casenum }}
            </li>
          </ul>
          <!-- text文本题 -->
          <p class="bt" v-if="textnum !== 0">【IPS写作题】</p>
          <ul>
            <li
              :class="
                texttopic.is_true == 0
                  ? 'no'
                  : texttopic.is_true == 1
                  ? 'yes'
                  : 'nodo'
              "
              v-for="(texttopic, index) in report.text_topic"
              :key="'case' + index"
            >
              {{ index + 1 + testnum + casenum }}
            </li>
          </ul>
          <!-- 底部按钮 -->
          <div class="four_btn">
            <router-link
              :to="{
                name: 'CFAnalysis'
              }"
              tag="a"
            >
              查看全部解析
            </router-link>
            <a @click="practiceAgain">再次练习</a>
            <router-link :to="{ name: 'questionbank' }" tag="a">
              返回首页
            </router-link>
          </div>
        </div>
      </div>
    </div>

    <!-- Dialog 做题模式/ 练习模式 -->
    <el-dialog
      title="请选择做题模式"
      :visible.sync="centerDialogVisible"
      width="32%"
      center
    >
      <div class="clearBox">
        <a href="javascript:void(0);" @click="questionbank_Keycode(1)">
          <el-image
            src="https://www.rongyuejiaoyu.com/static/static/img/lianximoshi.1eabfc1.png"
          ></el-image>
          <h6>练习模式</h6>
          <p>解题思路随时查看</p>
        </a>
        <a href="javascript:void(0);" @click="questionbank_Keycode(0)">
          <el-image
            src="https://www.rongyuejiaoyu.com/static/static/img/ceshimoshi.764e30d.png"
          ></el-image>
          <h6>背题模式</h6>
          <p>解题思路随时查看</p>
        </a>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      accuracy: '77',
      report: '',
      casenum: 0,
      testnum: 0,
      textnum: 0,
      centerDialogVisible: false
    }
  },
  created() {},
  methods: {
    practiceAgain() {
      this.centerDialogVisible = true
      console.log(213213)
    },
    questionbank_Keycode(id) {
      // 1.练习模式 2. 背题模式
      this.$router.push({
        path: '/exam_practice/Keycode',
        query: { cid: id }
      })
    }
  }
}
</script>

<style scoped lang="scss">
.el-breadcrumb {
  margin: 15px 0;
  height: 62px;
  line-height: 62px;
  padding-left: 12px;
  background-color: #ffff;
  font-size: 16px;
}

.CFAReport {
  margin-bottom: 20px;
}

.result {
  width: 100%;
  margin-top: 6px;
  .wrapper {
    padding: 0 104px;
    background: #fff;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    position: relative;
    p.recentlyfive {
      position: absolute;
      width: 80%;
      text-align: center;
    }
    p.zql {
      width: 24px;
      position: absolute;
      left: 300px;
      bottom: 245px;
    }
    p.test_title {
      height: 124px;
      line-height: 124px;
      font-size: 24px;
      color: #333;
      text-align: center;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    p.bt {
      font-size: 18px;
      color: #333;
      font-weight: bold;
    }
    .zuoc_l {
      text-align: center;
      margin-top: 25px;
      .zuoc_l2 {
        margin-top: 20px;
        span {
          font-size: 14px;
          color: #333;
          margin: 20px 20px;
          i {
            width: 14px;
            height: 14px;
            line-height: 14p;
            display: inline-block;
            vertical-align: middle;
            margin-right: 5px;
          }
          i.zuoc_l2_l {
            background: #47c88a;
          }
          i.zuoc_l2_r {
            background: #ddf3e8;
          }
        }
      }
    }
    .four_type {
      height: 168px;
      border-bottom: 1px solid #eeeeee;
      padding: 54px 0;
      box-sizing: border-box;
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      div {
        border-right: 1px solid #eee;
        width: 25%;
        text-align: center;
        p {
          font-size: 36px;
          span {
            font-size: 14px;
            color: #999999;
            margin-left: 10px;
          }
        }
        small {
          font-size: 14px;
          color: #999999;
          margin-top: 10px;
          display: block;
        }
      }
      div:last-child {
        border-right: none;
      }
    }
  }
}

.answer_card {
  width: 100%;
  margin: 20px 0;
  .wrapper {
    border: 2px solid #f8f8f8;
    padding: 0 104px 60px 104px;
    background: #fff;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    position: relative;
    p.test_title {
      height: 124px;
      line-height: 124px;
      font-size: 24px;
      color: #333;
      text-align: center;
    }
    p.answer_result {
      margin-bottom: 10px;
      span {
        line-height: 18px;
        margin-right: 30px;
        i {
          width: 18px;
          height: 18px;
          display: inline-block;
          -webkit-border-radius: 1px;
          -moz-border-radius: 1px;
          -ms-border-radius: 1px;
          -o-border-radius: 1px;
          border-radius: 1px;
          vertical-align: middle;
          margin-top: -2px;
          margin-right: 10px;
        }
        i.yes {
          background: #47c88a;
        }
        i.no {
          background: #ff8a8d;
        }
        i.nodo {
          border: 1px solid #c1c1c1;
          background: #fff;
          color: #333;
        }
      }
    }
    p.bt {
      font-size: 14px;
      color: #333;
      height: 85px;
      line-height: 95px;
    }
    ul {
      // zoom: 1;
      &:before,
      &:after {
        display: table;
        content: '';
      }
      &:after {
        clear: both;
      }
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      list-style: none;
      li {
        width: 30px;
        height: 30px;
        line-height: 30px;
        text-align: center;
        color: #fff;
        font-family: 'Microsoft Yahei';
        -webkit-border-radius: 2px;
        -moz-border-radius: 2px;
        -ms-border-radius: 2px;
        -o-border-radius: 2px;
        border-radius: 2px;
        margin: 0 20px 20px 0;
        float: left;
        cursor: pointer;
        box-sizing: border-box;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
      }
      li.yes {
        background: #47c88a;
      }
      li.no {
        background: #ff8a8d;
      }
      li.nodo {
        border: 1px solid #c1c1c1;
        background: #fff;
        color: #333;
      }
    }
    .four_btn {
      margin-top: 43px;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      padding: 0 25%;
      a {
        width: 120px;
        height: 36px;
        line-height: 36px;
        background: #47c88a;
        color: #fff;
        text-align: center;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        -ms-border-radius: 5px;
        -o-border-radius: 5px;
        border-radius: 5px;
        cursor: pointer;
      }
    }
  }
}

/* 做题模式 */
.clearBox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  a {
    text-align: center;
    .el-image {
      width: 100%;
      height: 100%;
      margin-bottom: 20px;
    }
    p {
      font-size: 14px;
      color: #999;
      line-height: 14px;
      margin: 10px 0 0;
    }
    h6 {
      font-size: 16px;
      color: #666;
      line-height: 16px;
      margin: 0;
      font-weight: normal;
    }
  }
}

::v-deep .el-dialog--center {
  padding: 45px 30px 0;
  background-image: url('@/assets/images/ex_pattern.png');
  background-repeat: no-repeat;
  background-position: 50% 50%;
}
::v-deep .el-dialog__header {
  padding: 0;
}
::v-deep .el-dialog__body {
  padding: 20px 10px 30px;
}

::v-deep .el-dialog__headerbtn {
  top: 0px;
  right: 12px;
  width: 32px;
  height: 36px;
  border-bottom-right-radius: 12px;
  border-bottom-left-radius: 12px;
  background-color: #ececec;

  .el-dialog__close {
    font-weight: bold;
    font-family: 'Microsoft Yahei';
    font-size: 20px;
  }
}
</style>
